<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: fzy-2
  Date: 2021/4/13
  Time: 15:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath(); %>
<html>
<head>
    <meta charset="utf-8">
    <title>上机考试系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <meta http-equiv="refresh" content="60">

    <!-- Le styles -->
    <link href="<%=path%>/css/bootstrap.css" rel="stylesheet">
    <link href="<%=path%>/css/exam.css" rel="stylesheet">
    <style>
        body {
            padding-top: 60px;
            /* 60px to make the container go all the way to the bottom of the topbar */
        }
    </style>
    <link href="<%=path%>/css/bootstrap-responsive.css" rel="stylesheet">

    <!-- le html5 shim, for ie6-8 support of html5 elements -->
    <!--[if lt ie 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>
<body>
<div class="container">
    <ul id="loginTab" class="nav nav-tabs">
        <li class="active"><a href="#student" data-toggle="tab">学生登录</a>
        </li>
        <li><a href="#teacher" data-toggle="tab">教师登录</a></li>
        <li><a href="#admin" data-toggle="tab">管理员登录</a></li>
    </ul>

    <div id="loginTabContent" class="tab-content">
        <div class="tab-pane fade in active" id="teacher">
            <div class="container">
                <div class="row vertical-center">
                    <div class="exam-login">
                        <h3>
                            <img class="img-circle" src="<%=path%>/img/exam-teacher.png" alt=""/>
                            教师登录
                        </h3>

                        <form class="exam-form" action="<%=path%>/teacher_login" method="post">
                            <p>
                                <label>
                                    <input type="text" name="name" placeholder="用户名" value="lisi"/>
                                </label> <br/> <label>
                                <input
                                        type="password" name="password" placeholder="口令" value="12345"/>
                            </label>
                            </p>
                            <p>
                                <input type="submit" class="btn btn-primary" value="登录"
                                       style="width: 100%"/>
                            </p>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="tab-pane fade in active" id="admin">
            <div class="container">
                <div class="row vertical-center">
                    <div class="exam-login">
                        <h3>
                            <img class="img-circle" src="<%=path%>/img/exam-admin.png" alt=""/>
                            管理员登录
                        </h3>

                        <form class="exam-form" action="<%=path%>/admin/admin_login" method="post">
                            <p>
                                <label>
                                    <input type="text" name="name" placeholder="用户名" value="admin1"/>
                                </label> <br/> <label>
                                <input
                                        type="password" name="pass" placeholder="口令" value="admin1"/>
                            </label>
                            </p>
                            <p>
                                <input type="submit" class="btn btn-primary" value="登录"
                                       style="width: 100%"/>
                            </p>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="tab-pane fade in active" id="student">
            <div class="container">
                <c:if test="${examname == null}">
                    <div class="exam-info">
                        <h4>当前没有进行中的考试，不能登录。</h4>
                    </div>
                </c:if>
                <c:if test="${examname != null}">
                    <div class="exam-info">
                        <h4>${examname}考试进行中，请尽快登录。</h4>
                    </div>
                </c:if>


                <div class="row vertical-center">
                    <div class="exam-login">
                        <h3>
                            <img class="img-circle" src="<%=path%>/img/exam-student.png" alt=""/>
                            学生登录
                        </h3>

                        <form class="exam-form" action="<%=path%>/student/student_login" method="post">
                            <p>
                                <label>
                                    <c:if test="${examname == null}">
                                        <input type="text" name="sno" placeholder="学号" disabled/>
                                    </c:if>
                                    <c:if test="${examname != null}">
                                        <input type="text" name="sno" placeholder="学号" value="1812030041"/>
                                    </c:if>
                                </label>
                                <br/>
                                <label>
                                    <c:if test="${examname == null}">
                                        <input type="text" name="sname" placeholder="姓名" disabled/>
                                    </c:if>
                                    <c:if test="${examname != null}">
                                        <input type="text" name="sname" placeholder="姓名" value="乔"/>
                                    </c:if>
                                </label>
                            </p>
                            <p>
                                <c:if test="${examname == null}">
                                    <input type="submit" class="btn" onclick="return false" value="登录" disabled
                                           style="width: 100%"/>
                                </c:if>
                                <c:if test="${examname != null}">
                                    <input type="submit" class="btn" value="登录" style="width: 100%"/>
                                </c:if>
                            </p>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<c:if test="${msg ne null}">
    <script>
        alert("${msg}");
    </script>
</c:if>
<!-- /container -->
<!-- Placed at the end of the document so the pages load faster -->
<SCRIPT src="<%=path%>/js/jquery.min.js"></SCRIPT>
<SCRIPT src="<%=path%>/js/bootstrap.min.js"></SCRIPT>
</body>
</html>